<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta content="telephone=no" name="format-detection" />
	<meta name="Description" content=""/>
	<meta name="Keywords" content=""/>
	<link href="favicon.ico" mce_href="favicon.ico" rel="bookmark" type="image/x-icon" />
	<link href="favicon.ico" mce_href="favicon.ico" rel="icon" type="image/x-icon" />
	<link href="favicon.ico" mce_href="favicon.ico" rel="shortcut icon" type="image/x-icon" />
	<title>盖网魔盒</title>
	<link rel="stylesheet" href="css/reset.css">
	<link rel="stylesheet" href="css/styles.css">
	<script src="js/jquery-2.2.2.min.js"></script>
	<script src="js/jquery.flexslider-min.js"></script>
	<script src="js/common.js"></script>
	<script src="json/gameJson.js"></script>	
	<script>
		$(function(){
			if(window.name=="gwmhLogined"){
				$("#authentication").attr("href","hasLogined.html");
			}
			
			var pre_pid=0;
			var count=0;
			$(gameData).each(function(){					
				var pid = this.pid;
				var href = this.href;
				var img = this.img;
				var gameName = this.gameName;
				var verify = this.verify;
				if(!verify){
					var li="<li><a href='"+href+"' title='"+gameName+"' onclick='javascript:$(\"#loading\").show()'><img src='"+img+"' alt='"+gameName+"'/><span class='game-name'>"+gameName+"</div>";
				}else{
					var li="<li><a href='javascript:void(0)' title='"+gameName+"' data-url='"+href+"' onclick='verify(this)'><img src='"+img+"' alt='"+gameName+"'/><span class='game-name'>"+gameName+"</div>";					
				}				
				if(pid!=pre_pid){
					count=0;
				}
				if(count<2){
					$("#game-type"+pid).find(".recomment-game").append(li+"</a></li>");
				}else{
					$("#game-type"+pid).find(".common-game").append(li+"<div class=decoration></div></a></li>");
				}
				count++;
				pre_pid=pid;								
			});
			//游戏认证
			$(".certification-box .close,.tip-box .close").click(function(){
				$(this).parent().parent().hide();
			})	
			$("#quit").click(function(){
				$("#to-login").hide();
			})	
		})
		function verify(obj){					
			if(window.name=="gwmhLogined"){ //已认证				
				$(obj).attr("href",$(obj).attr("data-url")); 
			}else{		
				$("#game-certification").show();		
				$("#game-start").click(function(){
					$("#game-certification").hide();
					$("#to-login").show();
				})
			}
		}
		
	</script>
</head>
<body>
	<header class="header">
		<a href="javascript:history.go(-1)" class="reback"></a>
	</header>
	<!--
	<nav class="nav">
		<a href="#">动作</a>
		<a href="#">体育</a>
		<a href="#" class="active">射击</a>
		<a href="#">冒险</a>
		<a href="#">解密</a>
		<a href="#">棋牌</a>
		<a href="#">模拟</a>
		<a href="#">益智</a>
	</nav>
	-->
	<section class="container">
		<div class="banner plate-banner">
			<ul class="slides">
				<li><a href="#" title="banner1"><img src="images/temp/banner/gameBanner02.jpg" alt="banner1" /></a></li>
				<li><a href="#" title="banner2"><img src="images/temp/banner/gameBanner01.jpg" alt="banner2" /></a></li>
				<li><a href="#" title="banner3"><img src="images/temp/banner/gameBanner03.jpg" alt="banner3" /></a></li>
			</ul>
			<div class="decoration"></div>
		</div>
		<div class="gray-wrap">
			<div class="game-list" id="game-type0">	
				<ul class="recomment-game clearfix"></ul>
				<ul class="common-game clearfix"></ul>
			</div>			
		</div>	
		<!--游戏认证提示弹窗-->
		<div id="game-certification" class="mask hide">
			<div class="certification-box">
				<i class="close"></i>
				<p>请先认证上网，认证完成后可畅玩游戏！</p>
				<div class="operation clearfix">
					<a href="javascript:void(0)" id="game-start" class="button style-01">我已认证，进入游戏</a>
					<a href="login.html" class="button style-02">去认证</a>
				</div>
			</div>
		</div>
		<!--提示弹窗-->
		<div id="to-login" class="mask hide">
			<div class="tip-box">
				<i class="close"></i>
				<p>对不起，您还没进行上网认证！</p>
				<div class="operation clearfix">
					<a href="login.html" class="button style-01">去认证</a>
					<a href="javascript:void(0)" id="quit" class="button style-02">暂时不玩了</a>
				</div>
			</div>
		</div>	
		<div id="loading" class="mask hide">
			<span class="loading"></span>
		</div>				
	</section>
	<footer class="footer">
		<ul class="menu clearfix">
			<li>
				<a href="index.html">
					<i class="icon ico-01 active"></i>
					<span>主页</span>
				</a>
			</li>
			<li>
				<a href="login.html" id="authentication">
					<i class="icon ico-02"></i>
					<span>认证上网</span>
				</a>
			</li>
			<li>
				<a href="social.html">
					<i class="icon ico-03"></i>
					<span>局域社交</span>
				</a>
			</li>
		</ul>
	</footer>	
</body>
</html>